package com.uk.data.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.uk.data.ejbs.AuditLog;

@Entity
@Table(name="TARIFA")
@EntityListeners(value=AuditLog.class)
public class Tarifa implements Serializable, Cloneable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6484334892566392638L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	@Column(length=5)
	private String kodi;
	
	@Column(length=100)
	private String pershkrimi;
	
	@Column(length=10)
	private String njesia;
	
	@Column(precision=3)
	private Double cmimi;
	
	
	private boolean aplikoTVSH = true;
	
	@Enumerated(EnumType.ORDINAL)
	private StatusEnum status;
	
	@Column(name="UK")
	private boolean uk = false;
	
	@Column(name="NE_LISTE")
	private boolean neListe = false;
	
	
	private String user;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DATA_REGJISTRIMIT")
	private Date dataRegjistrimit;
	
	
	
	public Tarifa(){
		
	}


	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public String getKodi() {
		return kodi;
	}


	public void setKodi(String kodi) {
		this.kodi = kodi;
	}


	public String getPershkrimi() {
		return pershkrimi;
	}


	public void setPershkrimi(String pershkrimi) {
		this.pershkrimi = pershkrimi;
	}


	public String getNjesia() {
		return njesia;
	}


	public void setNjesia(String njesia) {
		this.njesia = njesia;
	}


	public Double getCmimi() {
		return cmimi;
	}


	public void setCmimi(Double cmimi) {
		this.cmimi = cmimi;
	}





	public StatusEnum getStatus() {
		return status;
	}


	public void setStatus(StatusEnum status) {
		this.status = status;
	}


	public Date getDataRegjistrimit() {
		return dataRegjistrimit;
	}


	public void setDataRegjistrimit(Date dataRegjistrimit) {
		this.dataRegjistrimit = dataRegjistrimit;
	}


	public boolean isAplikoTVSH() {
		return aplikoTVSH;
	}


	public void setAplikoTVSH(boolean aplikoTVSH) {
		this.aplikoTVSH = aplikoTVSH;
	}


	public boolean isUk() {
		return uk;
	}


	public void setUk(boolean uk) {
		this.uk = uk;
	}


	public boolean isNeListe() {
		return neListe;
	}


	public void setNeListe(boolean neListe) {
		this.neListe = neListe;
	}


	public String getUser() {
		return user;
	}


	public void setUser(String user) {
		this.user = user;
	}


	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Tarifa [id=");
		builder.append(id);
		builder.append(", kodi=");
		builder.append(kodi);
		builder.append(", pershkrimi=");
		builder.append(pershkrimi);
		builder.append(", njesia=");
		builder.append(njesia);
		builder.append(", cmimi=");
		builder.append(cmimi);
		builder.append(", aplikoTVSH=");
		builder.append(aplikoTVSH);
		builder.append(", status=");
		builder.append(status);
		builder.append(", uk=");
		builder.append(uk);
		builder.append(", neListe=");
		builder.append(neListe);
		builder.append(", user=");
		builder.append(user);
		builder.append(", dataRegjistrimit=");
		builder.append(dataRegjistrimit);
		builder.append("]");
		return builder.toString();
	}


	
	public Tarifa clone() throws CloneNotSupportedException {
		// TODO Auto-generated method stub
		return (Tarifa) super.clone();
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Tarifa other = (Tarifa) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}





	
	
	
	
}
